package com.mydemo.springlearning.functions.memoryshare.service;

import com.mydemo.springlearning.functions.CRUDdemo.entity.User;
import com.mydemo.springlearning.functions.memoryshare.entity.BigUser;

import java.util.List;

public interface BigUserService {
    /**
     * 得到所有用户的数量
     * @return string,用户数量+耗时，例如：<br>用户数量：500149，查询耗时: 14.131267
     */
    String getTotalUserAmount();

    /**
     * 流式查询
     * @return
     */
    String getTotalUserAmountByStream();

    void add(User user) throws InterruptedException;

    List<User> get();

    String delete(String name);

    /**
     * 查询得到所有未删除的BigUser
     *
     * @return ds_deleted=0
     */
    List<BigUser> getAllBigUser();
    /**
     * <流式查询>查询得到所有未删除的BigUser
     *
     * @return ds_deleted=0
     */
    List<BigUser> getAllBigUserByStream();

    /**
     * 查询得到所有未删除的BigUser
     *
     * @return ds_deleted=0
     */
    List<BigUser> getAllBigUserLimit(int limit);

    /**
     * 流式查询+多线程加结果到list
     * @return
     */
    List<BigUser> getAllBigUserByMultiThread(int limit);

    /**
     * 流式查询+多线程加结果到list
     * @return
     */
    String getTotalUserAmountByStreamThread();
}
